package main

import (
	"fmt"
	"math"
)

/**
方法2
*/

//矩形
type Rectangle struct {
	width, height float64
}

//圆形
type Circle struct {
	radius float64
}

func (r Rectangle) getArea() float64 {
	return r.width * r.height
}

func (c Circle) getArea() float64 {
	return c.radius * c.radius * math.Pi
}

func getArea(width int,height int) int {
	return width*height
}
func main() {
	r1 := Rectangle{10, 20}
	c1 := Circle{radius: 100}

	fmt.Println(r1.getArea())
	fmt.Println(c1.getArea())
}
